package soundwave.com.demo.list;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;

import java.util.ArrayList;

import soundwave.com.demo.R;
import soundwave.com.demo.adpater.ShoppingList_adapert;
import soundwave.com.demo.test.Shoppingcontent_test;

/**
 * Created by xu on 2017/3/25.
 */

public class ShoppingList extends Activity {
    private ListView listView;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.shoppingcart);
        listView= (ListView) findViewById(R.id.shoplist);

        ArrayList<Shoppingcontent_test> shoppingcontent=new ArrayList<>();
        Shoppingcontent_test shoppingcontenttest =new Shoppingcontent_test();
        shoppingcontenttest.setTitle("123");
        shoppingcontenttest.setAddress("上海");
        shoppingcontenttest.setMoney(15.2f);
        shoppingcontent.add(shoppingcontenttest);


        ShoppingList_adapert shoppingListadapert =new ShoppingList_adapert(this,R.layout.shoppinglist_content,shoppingcontent);
        listView.setAdapter(shoppingListadapert);
        shoppingListadapert.notifyDataSetChanged();
        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
                
            }
        });
    }
}
